package dejava.bolsadetrabajo.repository.conexionDB;

import java.sql.Connection;

public class ConexionMySQL {
	public static Connection con_mysql;
	public static Connection conectar(String pHost, String pUser, String pPassword, String pDataBase) throws Exception {
		try {
			String databaseURL = "jdbc:mysql://" + pHost + "/" + pDataBase;
			Class.forName("com.mysql.jdbc.Driver");
			con_mysql = java.sql.DriverManager.getConnection(databaseURL, pUser, pPassword);
			//System.out.println("Conexion con MySQL Establecida..");
		} catch (Exception e) {
			e.printStackTrace();
			throw new Exception(e);
		}
		return con_mysql;
	}

}
